package main

import "fmt"

func main() {
	var l []func()
	all := []int{1, 2, 3, 4}
	for _, i := range all {
		l = append(l, func() {
			fmt.Println(i)
		})
		fmt.Println(i)
	}
	for _, i := range l {
		i()
	}
}
